package model;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;

public class WriteIntegerToFile {
	int[] a;
	
	//constructor
	public WriteIntegerToFile() {
		a = new int[5];
	}
	
	//gettor
	
	//settor
	
	//nhap du lieu
	public int[] enterDataA() {
		Scanner scanner = new Scanner(System.in);
		for(int i = 0; i < 5; i++) {
			System.out.println("Pt " + i + ": ");
			a[i] = scanner.nextInt();
		}
		return a;
	}
	
	public void writeFile() {
		File fOut = new File("b.txt");
		PrintWriter out;
		try {
			out = new PrintWriter(fOut);
			for(int i = 0; i < 5; i++) {
				out.println(a[i]);
			}
			out.close();
		}
		catch(FileNotFoundException e) {
			System.out.println("Error: " + e);
		}
		
	}
	
	

}
